package com.maserb.monitor.repository.schoolStudent;

import com.maserb.monitor.entity.card.EcCardEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

/**
 * 卡德一卡通发卡信息Rep
 */
@Repository
public interface EcCardRepository extends JpaSpecificationExecutor<EcCardEntity>
        , PagingAndSortingRepository<EcCardEntity, String> {

    @Query(value = "select c from EcCardEntity c left join c.student s where s.id=?1")
    EcCardEntity findByStudentId(String studentId);

    EcCardEntity findFirstByCardNumber(String cardNumber);
}